<#assign base=request.contextPath />
<!doctype html>
<html lang="en" class="fixed">

<head>
    <meta charset="UTF-8">
    <title>Ikaros</title>
    <#include "../commons/headImport.ftl">
    <link href="${base}/static/plugins/tree/jslib/zTreeStyle/zTreeStyle.css" rel="stylesheet" type="text/css">
</head>

<body>
<div class="wrap">
    <#include "../commons/page-header.ftl">
    <div class="page-body">
        <#include "../commons/left-sidebar.ftl">
            <div class="content">
                <div class="content-header">
                    <div class="leftside-content-header">
                        <ul class="breadcrumbs">
                            <li><i class="fa fa-table" aria-hidden="true"></i><a href="#">Tables</a></li>
                            <li><a>Data-table</a></li>
                        </ul>
                    </div>
                </div>
                <div class="row animated fadeInRight">
                    <div class="col-sm-12">
                        <div class="panel">
                            <div class="panel-content">
                                <form class="form-search form-inline">
                                    <input class="form-control input-sm" type="search" /> <button type="submit" class="btn">查找</button>
                                    <ul id="treeDemo" class="ztree" style="width:260px; overflow:auto;"></ul>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        <#--content end-->

    </div>
</div>
<#include "../commons/foot.ftl">
<script type="text/javascript" src="${base}/static/plugins/tree/jslib/zTreeStyle/jquery.ztree.all-3.5.min.js"></script>
<#--<script src="${base}/static/js/admin/resourceTree.js"></script>-->
<script src="${base}/static/vendor/nano-scroller/nano-scroller.js"></script>
<script src="${base}/static/javascripts/template-script.min.js"></script>
<script src="${base}/static/javascripts/template-init.min.js"></script>
<SCRIPT type="text/javascript">
    <!--
    var setting = {
        check: {
            enable: true,
            chkStyle: "radio",
            radioType: "level"
        },
        data: {
            simpleData : {
                enable : true,
                idKey : "id",
                pIdKey : "pid",/*设置可以成json字段*/
                rootPId : ""
            }
        }
    };

    var zNodes =${list}

    var code;
    function setCheck() {
        var type = $("#level").attr("checked")? "level":"all";
        setting.check.radioType = type;
        showCode('setting.check.radioType = "' + type + '";');
        $.fn.zTree.init($("#treeDemo"), setting, zNodes);
    }
    function showCode(str) {
        if (!code) code = $("#code");
        code.empty();
        code.append("<li>"+str+"</li>");
    }

    $(document).ready(function(){
        setCheck();
        $("#level").bind("change", setCheck);
        $("#all").bind("change", setCheck);
    });
    //-->
</SCRIPT>
</body>
</html>